import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path';
import { VitePWA } from 'vite-plugin-pwa';

// https://vite.dev/config/
export default defineConfig({
  base: '/',
    plugins: [
        vue(),
        VitePWA({
          registerType: 'autoUpdate', // 确保自动更新注册
          inject: {
            injectManifest: true, // 确保注入manifest
          }
        })
    ],
    resolve: {
        alias: {
            '@': path.resolve(__dirname, 'src'),
        },
    },
})
